using Aurora.TaskScheduler.Extension;
using Aurora.TaskScheduler.Storage.MySql;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.

builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddTaskScheduler(options =>
{
    options.DefaultGroupName = "test";
    //options.Assemblies = new List<Assembly>() { typeof(Program).Assembly };
    options.UseMySql(x => x.ConnectionString = "server=192.168.10.78;user=root;database='jiradb';port=3308;password=123456;SslMode=None");
});
// builder.Services.AddQuartzUI();
var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

app.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();
app.UseTaskScheduler();

// app.UseQuartzUI();
app.Run();